

function gadget:GetInfo()
  return {
    name      = "Shipyard Anti-Stuck",
    desc      = "Teleports ships out from T3 shipyard build area.",
    author    = "Licho", --modified by Deadnight Warrior
    date      = "10.4.2009",
    license   = "GNU GPL, v2 or later",
    layer     = 0,
    enabled   = true --  loaded by default?
  }
end

local spGetUnitPosition = Spring.GetUnitPosition
local spGetUnitVectors = Spring.GetUnitVectors
local spGetUnitRadius = Spring.GetUnitRadius
local spSetUnitPosition = Spring.SetUnitPosition

if (gadgetHandler:IsSyncedCode()) then


function gadget:UnitFromFactory(unitID, unitDefID, teamID, builderID, builderDefID, _)
  if (UnitDefs[builderDefID].waterline > 60) then
    local ux,uy,uz = spGetUnitPosition(unitID)
    local f = spGetUnitVectors(builderID)
    local s = spGetUnitRadius(unitID) + 16
    spSetUnitPosition(unitID, ux + f[1]*s, uy + f[2]*s, uz + f[3]*s)
  end
end


end
